﻿using System.ComponentModel.DataAnnotations;
using Abp.Domain.Entities.Auditing;

namespace DHJ.Cost.Models
{
    /// <inheritdoc />
    /// <summary>
    /// 产品型号
    /// </summary>
    public class Model : FullAuditedEntity
    {
        protected Model()
        {
        }

        public Model(string code, string name, string description)
        {
            Code = code.Trim().ToUpper();
            Name = name;
            Description = description;
        }

        /// <summary>
        /// 型号代号
        /// </summary>
        [Required]
        public string Code { get; set; }

        /// <summary>
        /// 型号名称
        /// </summary>
        [Required]
        public string Name { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(CostConsts.MaxEntityDescriptionLength)]
        public string Description { get; set; }
    }
}